package com.google.guava.eventbus.listeners;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.google.common.eventbus.Subscribe;
import com.google.guava.eventbus.events.Apple;
import com.google.guava.eventbus.events.Fruit;

/**
 * @author fuc
 * @create 2020-10-05
 */
public class FruitEaterListener {
  private static final Log log = LogFactory.get();

  @Subscribe
  public void eat(Fruit event) {
    if (log.isInfoEnabled()) {
      log.info("Fruit eat [{}].", event);
    }
  }

  @Subscribe
  public void eat(Apple event) {
    if (log.isInfoEnabled()) {
      log.info("Apple eat [{}].", event);
    }
  }
}
